//
//  DECXDriverShowViewController.m
//  DECXInStore
//
//  Created by 李坤 on 2019/3/19.
//  Copyright © 2019年 程强. All rights reserved.
//

#import "DECXDriverShowViewController.h"
#import "DECXDriverObj.h"

@interface DECXDriverShowViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (strong, nonatomic) UITableView *driverTable;
@end

@implementation DECXDriverShowViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"提货司机";
    [self setupUI];
}
- (void)setupUI
{
    _driverTable = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    _driverTable.delegate = self;
    _driverTable.dataSource = self;
     [self.view addSubview:_driverTable];
    _driverTable.rowHeight = 44.0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.drivers.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *indentifier = @"DriverCell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indentifier];
    
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:indentifier];
    }
    DECXDriverObj *driver = self.drivers[indexPath.row];
    cell.textLabel.text = driver.user_name;
    cell.detailTextLabel.text = driver.phone;
    return cell;
}
@end
